package com.ym.curd.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ym.curd.bean.Department;
import com.ym.curd.dao.DepartmentMapper;

@Service
public class DepartmentService {

	//引入部门的映射接口
	@Autowired
	DepartmentMapper departmentMapper;
	//编写一个方法用来获取全部的部门
	public List<Department> getAll(){
		return departmentMapper.selectByExample(null);
	}
	//编写一个方法用来根据部门的ID获取部门信息
	public Department getDepartmentById(Integer deptId){
		return departmentMapper.selectByPrimaryKey(deptId);
	}
}
